package com.jetsum.micro.controller;

import com.jetsum.api.entity.Order;
import com.jetsum.api.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.LocalDateTime;

@RestController
public class TestController {

    @Resource
    private OrderService<Order> orderService;

    @GetMapping("/create")
    public String creatae(){
        Order order = new Order();
        order.setOrderNo(System.currentTimeMillis()+"");
        order.setCreatedTime(LocalDateTime.now());
        order.setOrderType(1);
        order.setCreatedBy("test");
        orderService.create(order);
        return "success";
    }
}
